// ignore_for_file: constant_identifier_names

enum ErrorCodeMsg {
  SYSTEM_ERROR(100000, "System error", ""), // 系统异常
  LOGIN_PARAM_IS_NOT_EMPTY(
      100001, "login info can not be empty", ""), // 登录信息不能为空
  USER_IS_NOT_EXIST(100002, "user not exsit", ""), // 用户不存在
  USER_OR_PASSWROD_IS_ERROR(
      100003, "account or password not correct", ""), // 账号或密码不对

  ERROR_PASSWORD_GT_LIMIT(
      100004, "login forbidden", ""), //半小时内密码输入错误十次，已限制登录30分钟
  USER_IS_EXIST(100005, "user has exsited", ""), // 用户已存在
  NEW_PASSWORD_EQUEAL_OLD_PASSWORD(
      100006, "new password can not be the same old one", ""), // 新老密码不能相同
  EMAIL_IS_EMPTY(100007, "email can not be empty", ""), //email不能为空
  USRE_IS_NOT_LOGIN(100008, "user had not login,please login in first",
      ""), //用户没登录,请重新登录,filter里面拦截token使用

  PASSWROD_IS_EMPTY(100009, "password can not be empty", ""), //密码不能为空

  CHARGE_AMOUNT_GT_ZERO(
      100010, "deposit amount should be greater than zero", ""), // 充值金额必须大于0

  PAY_IS_FAIL(100011, "deposit failed", ""), //支付失败

  PAYMENT_ORDER_IS_NOT_EMPTY(
      100012, "deposit order number can not be empty", ""), // 支付单号不能为空

  GT_CUR_LEVEL_WITHDRAW_AMOUNT(
      100013, "current withdraw amount not support", ""), // 超过当前用户等级单笔最大提现额

  GT_CUR_LEVEL_CUR_DAY_WITHDRAW_SIZE(
      100014, "your withdraw times has overed", ""), // 超过当前用户等级当天最大提现次数

  BANK_CODE_IS_EMPTY(100015, "bank code is needed", ""), // 银行编码不能为空

  RECEIVE_NAME_IS_EMPTY(100016, "account name is needed", ""), // 账户名称不能为空

  RECEIVE_ACCOUNT_IS_EMPTY(100017, "recieve account is needed", ""), // 收款账户不能为空

  TRANSFER_AMOUNT_IS_GT_ZERO(
      100018, "withdraw amount should greater than 0", ""), // 提现金额必须大于0

  UPDATE_USER_ACCOUNT_IS_FAIL(
      100019, "update account occurred error", ""), // 更新账户错误

  // Withdraw
  WITHDRAW_AMOUTN_GT_ACCOUNT_AMOUNT(
      100020, "oops! you do not have enough money", ""), // 提现超过账户余额

  USER_ACCOUNT_AMOUNT_IS_ZERO(100021, "your account amount is 0", ""), // 账户金额为0

  HAS_NO_PERMISSION(100022, "you have no rights", ""), // 无权限

  PARAM_IS_ERROR(100023, "parameter error", ""), // 参数错误

  DEPOSIT_FAIL(100024, "deposit failed", ""); // 充值失败

  final int code;

  final String nativeMsg;
  final String enMsg;
  const ErrorCodeMsg(this.code, this.enMsg, this.nativeMsg);
  static String getMsgByCode(int code) =>
      ErrorCodeMsg.values.firstWhere((element) => element.code == code).enMsg;
}
